﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using S9Engine;


public partial class _Default : Parser 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!CheckLogin()) Response.Redirect("login.aspx");

            if (Session["CurrentPage"] == null) Session["CurrentPage"] = _parser.GetConfig("DefaultPage", "category.aspx");

            Response.Redirect(Session["CurrentPage"].ToString());
        }
        catch (Exception ex)
        {
            WriteError(ex);
            Response.Write(ex.ToString());
        }
        finally
        {
            _parser.Parse("Main");
            _parser.Out("Main");
        }
    }
}